package com.eaoa.uc.busorder.form;

import java.math.BigDecimal;

import com.eaoa.base.EABaseForm;
import com.eaoa.vo.bus.BusCargo;
import com.stony.core.util.CoreUtils;

public class BusCargoForm extends EABaseForm {

	// primary key
	private String cargono;

	// fields
	private String cargoname;
	private String packagetype;
	private String number;
	private String weight;
	private String length;
	private String width;
	private String high;
	
	public void setVO(BusCargo vo){
		this.setCargono(CoreUtils.formatString(vo.getCargono()));
		this.setCargoname(vo.getCargoname());
		this.setPackagetype(vo.getPackagetype());
		this.setNumber(CoreUtils.formatString(vo.getNumber()));
		this.setWeight(CoreUtils.formatString(vo.getWeight()));
		this.setLength(CoreUtils.formatString(vo.getLength()));
		this.setWidth(CoreUtils.formatString(vo.getWidth()));
		this.setHigh(CoreUtils.formatString(vo.getHigh()));
	}
	
	public BusCargo getVO(){
		BusCargo po = new BusCargo();
		po.setCargono(CoreUtils.parseLong(this.getCargono()));
		po.setCargoname(this.getCargoname());
		po.setPackagetype(this.getPackagetype());
		po.setNumber(CoreUtils.parseLong(this.getNumber()));
		po.setWeight(CoreUtils.parseBigDecimal(this.getWeight(), "0"));
		po.setLength(CoreUtils.parseBigDecimal(this.getLength(), "0"));
		po.setWidth(CoreUtils.parseBigDecimal(this.getWidth(), "0"));
		po.setHigh(CoreUtils.parseBigDecimal(this.getHigh(), "0"));
		BigDecimal size = po.getLength().multiply(po.getWidth()).multiply(po.getHigh());
		po.setSize(size);
		return po;
	}
	
	public String getCargono() {
		return cargono;
	}
	public void setCargono(String cargono) {
		this.cargono = cargono;
	}
	public String getCargoname() {
		return cargoname;
	}
	public void setCargoname(String cargoname) {
		this.cargoname = cargoname;
	}
	public String getPackagetype() {
		return packagetype;
	}
	public void setPackagetype(String packagetype) {
		this.packagetype = packagetype;
	}
	public String getNumber() {
		return number;
	}
	public void setNumber(String number) {
		this.number = number;
	}
	public String getWeight() {
		return weight;
	}
	public void setWeight(String weight) {
		this.weight = weight;
	}

	public String getLength() {
		return length;
	}

	public void setLength(String length) {
		this.length = length;
	}

	public String getWidth() {
		return width;
	}

	public void setWidth(String width) {
		this.width = width;
	}

	public String getHigh() {
		return high;
	}

	public void setHigh(String high) {
		this.high = high;
	}
	
}
